﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ue.Qcdz.Domain.Shops;
using Ue.Qcdz.Domain.ShopSinglePages;

namespace Ue.Qcdz.Domain
{
    /// <summary>
    /// 商铺单页信息
    /// </summary>
    public partial class SiteUrls
    {

        /// <summary>
        /// 单页前台显示（列表绑定）
        /// </summary>
        /// <returns></returns>
        public string ShopSinglePageShow(object key)
        {
            return this.BuildUrl("ShopSinglePageShow", (key as ShopSinglePage).Key);
        }

        /// <summary>
        /// 单页前台显示（根据标题）
        /// </summary>
        /// <returns></returns>
        public string ShopSinglePageShow(string title)
        {
            ShopSinglePage model = ShopSinglePageService.GetSinglePage(title, SiteContext.GetSiteContext().Shop);
            if (model != null)
            {
                return this.BuildUrl("ShopSinglePageShow", model.Key);
            }
            return "#";
        }
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public string ShopSinglePages()
        {
            return this.BuildUrl("ShopSinglePages", null);
        }

        /// <summary>
        /// 添加
        /// </summary>
        /// <returns></returns>
        public string ShopSinglePageEdit()
        {
            if (SiteContext.GetSiteContext().User != null)
            {
                Shop shop = SiteContext.GetSiteContext().Shop;
                if (shop != null)
                    return this.BuildUrl("ShopSinglePageEdit", null);
            }
            return "#";
        }
    }
}
